//
//  UIViewController+Locker.m
//  抽屉
//
//  Created by 李劲成 on 16/5/26.
//  Copyright © 2016年 ljc. All rights reserved.
//

#import "UIViewController+Locker.h"
#import "LockerVC.h"
@implementation UIViewController (Locker)

- (LockerVC *)locker
{
    UIViewController *iter = self.parentViewController;
    while (iter) {
        if ([iter isKindOfClass:[LockerVC class]]) {
            return (LockerVC *)iter;
        } else if (iter.parentViewController && iter.parentViewController != iter) {
            iter = iter.parentViewController;
        } else {
            iter = nil;
        }
    }
    return nil;
}

#pragma mark -
#pragma mark IB Action Helper methods

- (IBAction)presentLeftMenuViewController:(id)sender
{
    [self.locker presentLeftMenuViewController];
}


@end
